﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Services;
using RS.BL;

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            LoadSettings();
        }


    }

    private void LoadSettings()
    {
        List<ObjBase> lstNationality = new List<ObjBase>();
        ObjBase national = new ObjBase();
        national.ID="1";
        national.Name="India";
        lstNationality.Add ( national);

        national = new ObjBase();
        national.ID="2";
        national.Name="Singapore";
        lstNationality.Add ( national);

        cmbNationality.DataSource = lstNationality;
        cmbNationality.DataTextField = "Name";
        cmbNationality.DataValueField = "ID";
        cmbNationality.DataBind();

        List<ObjBase> lstVisaStatus = new List<ObjBase>();
        ObjBase visastatus = new ObjBase();
        visastatus.ID = "1";
        visastatus.Name = "India";
        lstVisaStatus.Add(visastatus);

        visastatus = new ObjBase();
        visastatus.ID = "2";
        visastatus.Name = "Singapore";
        lstVisaStatus.Add(visastatus);

        cmbVisaStatus.DataSource = lstVisaStatus;
        cmbVisaStatus.DataTextField = "Name";
        cmbVisaStatus.DataValueField = "ID";
        cmbVisaStatus.DataBind();

        //assigning default values for testin
        txtFN.Text = "vijaya mohan";
        txtLN.Text = "Vengala";
        rbdGender.SelectedIndex = 1;
        cmbNationality.SelectedIndex = 1;
        txtContactNumber.Text = "98534041";
        txtEmail.Text = "vijaya.mohan@gmail.com";
        cmbVisaStatus.SelectedIndex = 1;
        txtAddress.Text = "BLK 459";
        txtExperience.Text = "10";
        txtRelavantExp.Text = "5";
        txtNoticePeriod.Text = "1.5";
        txtCurrentSalary.Text = "4000";
        txtExpSalFrom.Text = "5000";
        txtExpSalTo.Text = "5500";
        txtResTitle.Text = ".Net developer";
        txtResumeText.Text = "resume text format";




    }

    [WebMethod]
    public static string AddResume( ResumeSubmitDTO objResumeSubmit,string name)
    {
        try
        {
            string custname = objResumeSubmit.FirstName;
            BLResumeSubmit _blResumeSubmit = new BLResumeSubmit();
            _blResumeSubmit.Save(objResumeSubmit);
            
        }
        catch (Exception ex)
        {
            
            throw ex;
        }

        return "Success";
    }
}
